﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows.Forms;
using CoderJoe.WoW.Services;
using Microsoft.Practices.Unity;
using CoderJoe.WoW.GearManager.Views;

namespace CoderJoe.WoW.GearManager
{
	static class Program
	{
		/// <summary>
		/// The main entry point for the application.
		/// </summary>
		[STAThread]
		static void Main()
		{
			Application.EnableVisualStyles();
			Application.SetCompatibleTextRenderingDefault(false);

			using(Workspace workspace = new Workspace())
			{
				workspace.RegisterType<ItemService>(new ContainerControlledLifetimeManager());
				workspace.RegisterType<CharacterService>(new ContainerControlledLifetimeManager());
				workspace.RegisterType<CharacterController>(new ContainerControlledLifetimeManager());
                workspace.RegisterType<ItemToolTipController>(new ContainerControlledLifetimeManager());
                workspace.RegisterType<EquipmentButtonController>(new ContainerControlledLifetimeManager());
				workspace.RegisterType<LoadCharacterController>();
			
				//CharacterService service = workspace.Resolve<CharacterService>();
				//Character character = service.GetCharacterFromArmory("Medivh", "Essiaa");
				//character.Name = character.Name;

				using (MainForm form = new MainForm(workspace))
				{
					Application.Run(form);
				}
			}
		}
	}
}
